package com.model.demo.designmodel.observer.gper;

import java.util.Observable;
import java.util.Observer;

/**
 * 观察者
 */
public class Teacher implements Observer {
    private  String name;

    public Teacher(String name) {
        this.name = name;
    }



    @Override
    public void update(Observable o, Object arg) {
        GPer gper = (GPer) o;
        Question question = (Question) arg;
        System.out.println("*****************");
        System.out.println(question.getUserName() + "在" + gper.getName() + "上问：" );
        System.out.println(question.getContent());
        System.out.println(name + "老师请解答！");

    }
}
